#include<iostream>
using namespace std;
const int N = 1e5 + 5;
int a[N], prex[N], cnt[N];
int main()
{
    int n; cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) prex[i] = prex[i - 1] ^ a[i];
    int ans = n * (n + 1) / 2;
    cnt[0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= 200; j++) {
            int sql = j * j;
            ans -= cnt[prex[i] ^ sql];
        }
        cnt[prex[i]]++;
    }
    cout << ans << endl;
    return 0;
}